luminosity

Computes the luminosity of a color as

L = ( max(r,g,b) + min(r,g,b) ) / 2